<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/mainstyle.css"/>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link rel="stylesheet" href="./css/themes/base/jquery.ui.all.css">
	<script src="./js/jquery-1.6.2.min.js"></script>
	<script src="./js/external/jquery.bgiframe-2.1.2.js"></script>
	<script src="./js/ui/jquery.ui.core.js"></script>
	<script src="./js/ui/jquery.ui.widget.js"></script>
	<script src="./js/ui/jquery.ui.mouse.js"></script>
	<script src="./js/ui/jquery.ui.button.js"></script>
	<script src="./js/ui/jquery.ui.draggable.js"></script>
	<script src="./js/ui/jquery.ui.position.js"></script>
	<script src="./js/ui/jquery.ui.resizable.js"></script>
	<script src="./js/ui/jquery.ui.dialog.js"></script>
    <script src="./js/ui/jquery.ui.datepicker.js"></script>
    <script src="./js/ui/i18n/jquery.ui.datepicker-zh-CN.js"></script>
    <link rel="stylesheet" href="./css/demos.css">
<title>推荐送话费日志</title>
</head>

<script>

	function delete_confirm()
	{
		if (confirm("确定要删除这个推荐吗?"))  {
			 return true;	
		}
		return false;	
	}
	
function post_list(index,curpage,maxpage)
{ 
     if (parseInt(index) <= parseInt(maxpage) && parseInt(index) > 0  && parseInt(curpage)!=parseInt(index) )
	 {
        document.form1.action = '?action=list&curpage='+index+'&agent_id=<% $agent_id %>'; 
	    document.form1.submit(); 
	    return true;
	 }
	 return false;
}

function  change_acct_id(acct_id)
{
	    document.form1.submit(); 
	    return true;		 
	
}


	
    
 </script>

<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="30"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="24" bgcolor="#353c44"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                
                <td width="97%" valign="bottom"><span  align="left" class="table_caption">推荐送话费记录
                </span></td>
              </tr>
            </table></td>
            <td><div align="right"><span class="STYLE1"></span>
             
             
             
             </div></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#a8c7ce">
    
<form name="form1" method="post" action="?action=list">

 
         <tr>
           <td height="24" colspan="11"   bgcolor="#FFFFFF" class="STYLE6"><span class="STYLE1">代理商
            <select name="agent_id" class="STYLE1" id="agent_id" onchange= "change_acct_id(this.value)"  >
                <option  value="" > --全部-- </option>
                <option  value="<% $res_acct.decode_id%>"  <% if $res_acct.decode_id eq $agent_id %> selected <%/if%>> <% $res_acct.acctname %> </option>
                  <%foreach from=$acctchild item=eachone key=keyname %>
                  <option  value="<% $eachone.decode_id %>" <% if $eachone.decode_id eq $agent_id %> selected="selected" <%/if%> >
                    <% $eachone.acctname %>
                  </option>
                  <%/foreach%>
              </select>
推荐结果
<select name="state" class="STYLE1" id="state" >
  <option  value="-1"  > 不限 </option>
  <option  value="0" <% if $post_data.state eq '0' %> selected <%/if%>  > 发起 </option>
  <option  value="1" <% if $post_data.state eq '1' %> selected <%/if%>  > 成功 </option>
</select>
<label for="user_acctname"><span class="table_title">用户帐号</span></label>
<input name="user_acctname" type="text" class="STYLE1" id="user_acctname" size="20" maxlength="30" value='<% $post_data.user_acctname %>' /> 
<label for="tel"><span class="table_title">被推荐</span></label>
<input name="tel" type="text" class="STYLE1" id="tel" size="20" maxlength="30" value='<% $post_data.tel %>' /> 
日期
<select name="datetype" class="STYLE1" id="datetype" >
  <option  value="-1"  > 不限 </option>
  <option  value="1" <% if $post_data.datetype eq '1' %> selected <%/if%>  > 发起日期 </option>
  <option  value="2" <% if $post_data.datetype eq '2' %> selected <%/if%>  > 成功日期 </option>
</select>
<input type="text"  name="begintime" id="begintime"   size="8"  value='<% $post_data.begintime %>' />
-
<input type="text"  name="endtime"   id="endtime" size="8" value='<% $post_data.endtime %>' />
<input name="querybtn" type="submit" class="STYLE1"   id="querybtn"  value=" 查询 " />
<input name="checkbox_downloadfile" type="checkbox" class="STYLE1"   />
<label for="downloadfile">导出</label>
           </span></td>
         </tr>
          </form>
<tr>
 
    <td width="4%" height="24"   bgcolor="d3eaef" class="STYLE6"><div align="center" class="table_title">序号</div></td>
	 <td width="10%" height="24"  bgcolor="d3eaef" class="STYLE6"><div align="center" class="table_title">区域</div></td>
	  <td width="10%" height="24"  bgcolor="d3eaef" class="STYLE6"><div align="center" class="table_title">部门</div></td>
    <td width="10%" height="24"  bgcolor="d3eaef" class="STYLE6"><div align="center" class="table_title">员工</div></td>
    <td width="10%"  height="24"  bgcolor="d3eaef" class="STYLE6"><div align="center" class="table_title">推荐账号</div></td>
    <td width="10%"  height="24"   bgcolor="d3eaef" class="STYLE6"><div align="center" class="table_title">被推荐账号</div></td>
    <td width="12%" height="24"   bgcolor="d3eaef" class="STYLE6"><div align="center" class="table_title">推荐时间</div></td>
    <td width="6%"  height="24"  bgcolor="d3eaef" class="STYLE6"><div align="center" class="table_title">状态</div></td>
    <td width="6%" height="24"  bgcolor="d3eaef" class="STYLE6"><div align="center" class="table_title">金额</div></td>
    <td width="12%" height="24"   bgcolor="d3eaef" class="STYLE6"><div align="center" class="table_title">成功时间</div></td>
	<% if $res_acct.accttype eq '1' %>
	<td width="6%" height="24"   bgcolor="d3eaef" class="STYLE6"><div align="center" class="table_title">操作</div></td>
	<% /if %> 
</tr>     

  <% foreach from=$table_array item=eachone key=keyname %>  	
  <tr>
    <td height="20" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center" class="STYLE19" > <% $eachone.check_id %> </div></td>
	<td height="20" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center" class="STYLE19" > <% $eachone.areacode %> </div></td>
	<td height="20" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center" class="STYLE19" > <% $eachone.position %> </div></td>
	<td height="20" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center" class="STYLE19" > <% $eachone.agent_acctname %> </div></td>
	<td height="20" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center" class="STYLE19" > <% $eachone.acctname %> </div></td>
	<td height="20" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center" class="STYLE19" > <% $eachone.tel %> </div></td>
	<td height="20" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center" class="STYLE19" > <% $eachone.createtime %> </div></td>
	<td height="20" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center" class="STYLE19" > <% if $eachone.state  eq '0' %>发起<%elseif $eachone.state  eq '2'%>成功<%else%><% $eachone.state %><%/if%> </div></td>
	<td height="20" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center" class="STYLE19" > <% $eachone.balance %> </div></td>
	<td height="20" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center" class="STYLE19" > <% $eachone.paydate %> </div></td>
	<% if $res_acct.accttype eq '1' %>
	<td height="20" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center" class="STYLE19" > 
	<a href="?action=del_post&id=<% $eachone.decode_id %>&curpage=<% $curpage %>&agent_id=<% $agent_id %>"  onClick="return delete_confirm()" >删除</a>
	 </div></td>
	<% /if %> 
</tr>
 <% /foreach %>                      
                        
                   
    </table></td>
  </tr>
  <tr>
    <td height="30"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="66%"><div align="left"><span class="STYLE21">共
              <% $record_count %>
              条记录，合计金额:<% $total_fee|string_format:"%.2f" %>元 当前第
              <% $curpage %>
              /
              <% $maxpage %>
              页，每页
              <% $pagelimtcount %>
          条记录</span></div></td>
        <td width="34%"><table width="180" border="0" align="right" cellpadding="0" cellspacing="0">
          <tr>
            <td width="40"><div align="center"> <a href="#" class="STYLE21" onClick="return post_list('1',<% $curpage %>,'<% $maxpage %>')"  >首页</a> </div></td>
            <td width="40"><div align="center"> <a href="#" class="STYLE21" onClick="return post_list('<% $curpage-1 %>','<% $curpage %>','<% $maxpage %>')" >上一页</a></div></td>
            <td width="40"><div align="center"> <a href="#" class="STYLE21" onClick="return post_list('<% $curpage+1 %>','<% $curpage %>','<% $maxpage %>')" >下一页</a></div></td>
            <td width="40"><div align="center"> <a href="#" class="STYLE21" onClick="return post_list('<% $maxpage  %>' ,'<% $curpage %>','<% $maxpage %>')" >尾页</a></div></td>
           
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>

<script>
	$(function() {
			
	    /*日期选择*/		
  		$( "#endtime" ).datepicker( $.datepicker.regional[ "zh-CN" ] );
		$( "#begintime" ).datepicker( $.datepicker.regional[ "zh-CN" ] );
	});
		
      
</script>
	
</body>
	
		

</html>
